﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ServiceModel;
using Fcdbas.Core.WCF.TransFile.Contracts.Models;
using Fcdbas.Core.WCF.TransFile.Contracts.Enums;

namespace Fcdbas.Core.WCF.TransFile.Contracts.Services
{

    ///<summary>
    ///时间:   2011-09-15
    ///描述:   文件传输服务
    ///<summary>
    [ServiceContract]
    public interface IFileService
    {
        /// <summary>
        /// 尝试连接服务器
        /// </summary>
        /// <returns>是否连接成功</returns>
        [OperationContract]
        bool TryConnection();

        /// <summary>
        /// 上传文件
        /// </summary>
        [OperationContract]
        LoadFileInfoModel UpLoadFile(LoadFileInfoModel info);

        [OperationContract]
        LoadFileInfoModel DownLoadFile(LoadFileInfoModel info);

        /// <summary>
        /// 检测文件
        /// </summary>
        [OperationContract]
        CheckFileResult CheckFile(LoadFileInfoModel info);

        /// <summary>
        /// 获取偏移量
        /// </summary>
        [OperationContract]
        GetOffSetResult GetFileOffSet(LoadFileInfoModel info, bool createNew);

        /// <summary>
        /// 删除文件
        /// </summary>
        [OperationContract]
        CheckFileResult DeleteFile(LoadFileInfoModel info);

        /// <summary>
        /// 获取下载文件大小
        /// </summary>
        [OperationContract]
        long GetDownLoadFileSize(SpaceType loadSpaceType, string customFolder, List<string> relativePaths);


        /// <summary>
        /// 移动文件
        /// </summary>
        /// <param name="loadSpaceType">文件存储类型</param>
        /// <param name="customFolder">自定义文件夹</param>
        /// <param name="originalPath">原始路径</param>
        /// <param name="targetPath">目标路径</param>
        /// <returns></returns>
        [OperationContract]
        TransFilesResult TransFilesMove(TransFilesOnServerModel item);

        /// <summary>
        /// 移动复制
        /// </summary>
        /// <param name="loadSpaceType">文件存储类型</param>
        /// <param name="customFolder">自定义文件夹</param>
        /// <param name="originalPath">原始路径</param>
        /// <param name="targetPath">目标路径</param>
        /// <returns></returns>
        [OperationContract]
        TransFilesResult TransFilesCopy(TransFilesOnServerModel item);

        /// <summary>
        /// 验证文件
        /// </summary>
        /// <param name="loadSpaceType">文件存储类型</param>
        /// <param name="customFolder">自定义文件夹</param>
        /// <param name="originalPath">原始路径</param>
        /// <param name="targetPath">目标路径</param>
        /// <returns></returns>
        [OperationContract]
        TransFilesResult CheckFileOnServer(TransFilesOnServerModel item);
    }
}
